package com.corona.game;

import com.corona.Game;

import java.util.Locale;

/* compiled from: Battle.java */
/* loaded from: pokewilds.jar:com/pkmngen/game/GainExpAnimation.class */
class GainExpAnimation extends Action {
    Pokemon pokemon;

    public GainExpAnimation(Pokemon pokemon, Action nextAction) {
        super(new Object[0]);
        this.pokemon = pokemon;
        this.nextAction = nextAction;
    }

    @Override // com.corona.game.Action
    public void step(Game game) {
        if (this.pokemon.level >= 100 || this.pokemon.calcExpForLevel(this.pokemon.level + 1) > this.pokemon.exp) {
            game.actionStack.remove(this);
            game.insertAction(new DisplayText.Clear(game, new WaitFrames(game, 3, this.nextAction)));
            return;
        }
        this.pokemon.gainLevel(1);
        game.actionStack.remove(this);
        game.insertAction(new DisplayText.Clear(game, new WaitFrames(game, 3, new DisplayText(game, this.pokemon.nickname.toUpperCase(Locale.ROOT) + " grew to level " + this.pokemon.level + "!", "fanfare1.ogg", true, true, (Action) new CheckMovesLearned(this.pokemon, this)))));
        this.pokemon.gainedLevel = true;
    }
}
